package net.wang.totakecodenotes.wechatofficaccounts.utils;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * 依赖于J
 */
public class JSONUtils {
    public static <T> T getEntity(String jsonString, Class<T> clazz) throws Exception {
        try {
            return new ObjectMapper().readValue(jsonString, clazz);
        } catch (Exception e) {
            e.printStackTrace();
            throw new Exception("转换异常");
        }
    }
}
